import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';

@Component({
  selector: 'app-c-button',
  templateUrl: './c-button.component.html',
  styleUrls: ['./c-button.component.less']
})
export class CButtonComponent implements OnInit {
    @Output() dataChange = new EventEmitter<object>();
    @Output() onBlur = new EventEmitter<object>();

    @Input() canEdit;

    _text;
    @Input() data;
    set text(value) {
        this.data.text = value;
    }

    get text() {
        if ( !this.data.text) {
            return '按钮名称';
        } else {
            return this.data.text;
        }
    }

    constructor() { }

    ngOnInit() {

    }

    blur() {
        this.onBlur.emit();
    }



}
